﻿namespace VisualSVN.Core.Licensing
{
    using System;
    using VisualSVN.Core;

    public class EncoderSequence : IEncoder
    {
        private IEncoder[] encoders;

        public EncoderSequence(params IEncoder[] encoders)
        {
            this.encoders = encoders;
        }

        public byte[] Encode(byte[] data)
        {
            byte[] buffer = data;
            for (int i = 0; i < this.encoders.Length; i++)
            {
                buffer = this.encoders[i].Encode(buffer);
            }
            return buffer;
        }
    }
}

